var 品客缤图标 = "#fUI/UIWindow2.img/StagedGachapon/Creature/0/normal/2#";
var 心形图标 = "#fUI/UIWindow2.img/Megaphone/0#";
var one = "#fUI/UIPVP.img/UserRanking/NumRank/Survival/1#";
var two = "#fUI/UIPVP.img/UserRanking/NumRank/Survival/2#";
var three = "#fUI/UIPVP.img/UserRanking/NumRank/Survival/3#";
var 造型卡 = 5150040;
var 发型列表 = [];
var 定制理发价格 = 15000;
var 随机理发价格 = 6000;
var 定制美容价格 = 15000;
var 随机美容价格 = 6000;
var 皮肤染色 = [0, 1, 2, 3, 4, 6, 7, 8, 9, 10, 16];
var status = -1;
var selectionLog = [];

function start() {
    action(1, 0, 0)
}

function action(g, d, c) {
    if (cm.getzhizunvip() == 2) {
        发型列表 = 至尊女发型
    } else {
        发型列表 = 黄金女发型
    }
    var f = 发型列表[Math.floor(Math.random() * 发型列表.length)];
    var e = cm.getPlayer().getSecondHair();
    var a = 1;
    之前发型 = cm.getPlayerStat("HAIR");
    if (cm.getPlayer().isGM()) {
        cm.playerMessage(5, " status=" + status + " 当前发型代码：" + 之前发型 + " ")
    }
    if (status == 0 && g == 0) {
        cm.dispose();
        return
    }(g == 1) ? status++ : status--;
    selectionLog[status] = c;
    var b = -1;
    if (status <= b++) {
        cm.dispose()
    } else {
        if (status === b++) {
            if (cm.getPlayer().getCSPoints(1) >= 随机理发价格) {
                cm.getPlayer().modifyCSPoints(1, -随机理发价格, true);
                cm.getTopMsgFont("随机发型成功", 3, 20, 20, 0);
                cm.addTrait("魅力", 50);
                cm.forceStartQuest(10000086);
                cm.forceCompleteQuest(10000086);
                cm.set神之子女发型(f);
                cm.神之子更换完发型脸型对比UI(造型卡, a, e, f, 0, 0);
                cm.removeItem(造型卡);
                cm.dispose()
            } else {
                cm.playerMessage(-1, "好像没有钱？等有钱了再来吧！");
                cm.dispose()
            }
        }
    }
}
var 黄金女发型 = [48033, 48017, 48007, 47417, 47402, 47427, 47094, 47330, 47390, 47386, 47075, 47043, 47031, 47010, 47005, 41530, 47305, 47293, 44500, 44650, 44991, 44773, 44797, 43870, 38831, 44950, 44611, 44520, 44516, 44420, 37321, 34872, 34211, 44400, 41540, 44040, 42070, 41830, 41720, 41710, 41700, 41640, 41560, 41520, 41080, 39250, 38880, 38790, 38770, 38700, 38680, 38560, 38540, 38460, 38420, 38110, 37930, 37900, 37750, 37710, 37690, 37580, 34450, 34310, 34250, 34220, 34110, 34062, 31860, 31160, 31020, 38010, 38090, 38520];
var 至尊女发型 = [32720, 32730, 32740, 32750, 32760, 43980, 44000, 44030, 44040, 44050, 44070, 44090, 44110, 44180, 44190, 44310, 44320, 44380, 44400, 44420, 44430, 44470, 44480, 44490, 44500, 44510, 44520, 44590, 37670, 37680, 37700, 37710, 37740, 37750, 37760, 37810, 37900, 37930, 37980, 37990, 38010, 37440, 38020, 38070, 38080, 38090, 38100, 38110, 38120, 38140, 38150, 38390, 38460, 38490, 38500, 38520, 38540, 38560, 38580, 38600, 38630, 37460, 37480, 37500, 37510, 37530, 37580, 37590, 37620, 37630, 44610, 44650, 44790, 44810, 44820, 44830, 44840, 34110, 34130, 34770, 34780, 34830, 34840, 34850, 34860, 34870, 34940, 34960, 34970, 37000, 37010, 37020, 37040, 37060, 34160, 34180, 34210, 34220, 34250, 34260, 34310, 34340, 34450, 34720, 34750, 44850, 44900, 44910, 44930, 44940, 34060, 47010, 47020, 47030, 47050, 47060, 47070, 47080, 47090, 47350, 47360, 47370, 47380, 47390, 31020, 47420, 47430, 47440, 47450, 47520, 47540, 31230, 31450, 48010, 31630, 48020, 31640, 48030, 48040, 48050, 31670, 48060, 31680, 48070, 48080, 48100, 31760, 48150, 48160, 48170, 48180, 31800, 48190, 31820, 48210, 48220, 48230, 31900, 48320, 31940, 48330, 48340, 48350, 48360, 48410, 48430, 48440, 48450, 48460, 48470, 48480, 48490, 48500, 48510, 48520, 48530, 48550, 48560, 48570, 48610, 48630, 48640, 48650, 48760, 48770, 48790, 48800, 38680, 38700, 38760, 38770, 38790, 38830, 38930, 41080, 41110, 41120, 41150, 41160, 41340, 41450, 41510, 41530, 41540, 41570, 41580, 41610, 41620, 41630, 41640, 41650, 41670, 41690, 41700, 41710, 41720, 41770, 41780, 41800, 41810, 41820, 41830, 41840, 41930, 41940, 42040];

function randomNum(b, a) {
    switch (arguments.length) {
        case 1:
            return parseInt(Math.random() * b + 1, 10);
            break;
        case 2:
            return parseInt(Math.random() * (a - b + 1) + b, 10);
            break;
        default:
            return 0;
            break
    }
};